Optimal. Leaf size=117 \[ \frac {A-i B}{8 a^2 c f (\tan (e+f x)+i)}-\frac {-B+i A}{8 a^2 c f (-\tan (e+f x)+i)^2}+\frac {x (3 A-i B)}{8 a^2 c}-\frac {A}{4 a^2 c f (-\tan (e+f x)+i)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.19, antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3588, 77, 203} \[ \frac {A-i B}{8 a^2 c f (\tan (e+f x)+i)}-\frac {-B+i A}{8 a^2 c f (-\tan (e+f x)+i)^2}+\frac {x (3 A-i B)}{8 a^2 c}-\frac {A}{4 a^2 c f (-\tan (e+f x)+i)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 77
Rule 203
Rule 3588
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))} \, dx &=\frac {(a c) \operatorname {Subst}\left (\int \frac {A+B x}{(a+i a x)^3 (c-i c x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (\frac {i (A+i B)}{4 a^3 c^2 (-i+x)^3}-\frac {A}{4 a^3 c^2 (-i+x)^2}+\frac {-A+i B}{8 a^3 c^2 (i+x)^2}+\frac {3 A-i B}{8 a^3 c^2 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {i A-B}{8 a^2 c f (i-\tan (e+f x))^2}-\frac {A}{4 a^2 c f (i-\tan (e+f x))}+\frac {A-i B}{8 a^2 c f (i+\tan (e+f x))}+\frac {(3 A-i B) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 a^2 c f}\\ &=\frac {(3 A-i B) x}{8 a^2 c}-\frac {i A-B}{8 a^2 c f (i-\tan (e+f x))^2}-\frac {A}{4 a^2 c f (i-\tan (e+f x))}+\frac {A-i B}{8 a^2 c f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 2.31, size = 129, normalized size = 1.10 \[ -\frac {2 (A-3 i B) \cos (2 (e+f x))+(B+3 i A) \sin (3 (e+f x)) \sec (e+f x)-12 A f x \tan (e+f x)+6 i A \tan (e+f x)+12 i A f x-7 A-2 B \tan (e+f x)+4 i B f x \tan (e+f x)+4 B f x+i B}{32 a^2 c f (\tan (e+f x)-i)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.66, size = 81, normalized size = 0.69 \[ \frac {{\left (4 \, {\left (3 \, A - i \, B\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-2 i \, A - 2 \, B\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (6 i \, A - 2 \, B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, A - B\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{32 \, a^{2} c f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 4.75, size = 169, normalized size = 1.44 \[ \frac {\frac {2 \, {\left (3 i \, A + B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{2} c} + \frac {2 \, {\left (-3 i \, A - B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{2} c} - \frac {2 \, {\left (3 \, A \tan \left (f x + e\right ) - i \, B \tan \left (f x + e\right ) + 5 i \, A + 3 \, B\right )}}{a^{2} c {\left (-i \, \tan \left (f x + e\right ) + 1\right )}} + \frac {9 i \, A \tan \left (f x + e\right )^{2} + 3 \, B \tan \left (f x + e\right )^{2} + 26 \, A \tan \left (f x + e\right ) - 6 i \, B \tan \left (f x + e\right ) - 21 i \, A + B}{a^{2} c {\left (\tan \left (f x + e\right ) - i\right )}^{2}}}{32 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.43, size = 209, normalized size = 1.79 \[ \frac {A}{8 f \,a^{2} c \left (\tan \left (f x +e \right )+i\right )}-\frac {i B}{8 f \,a^{2} c \left (\tan \left (f x +e \right )+i\right )}+\frac {3 i \ln \left (\tan \left (f x +e \right )+i\right ) A}{16 f \,a^{2} c}+\frac {\ln \left (\tan \left (f x +e \right )+i\right ) B}{16 f \,a^{2} c}+\frac {B}{8 f \,a^{2} c \left (\tan \left (f x +e \right )-i\right )^{2}}-\frac {i A}{8 f \,a^{2} c \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {A}{4 f \,a^{2} c \left (\tan \left (f x +e \right )-i\right )}-\frac {3 i \ln \left (\tan \left (f x +e \right )-i\right ) A}{16 f \,a^{2} c}-\frac {\ln \left (\tan \left (f x +e \right )-i\right ) B}{16 f \,a^{2} c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.77, size = 129, normalized size = 1.10 \[ \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {3\,A}{8\,a^2\,c}-\frac {B\,1{}\mathrm {i}}{8\,a^2\,c}\right )+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {B}{8\,a^2\,c}+\frac {A\,3{}\mathrm {i}}{8\,a^2\,c}\right )-\frac {B}{4\,a^2\,c}+\frac {A\,1{}\mathrm {i}}{4\,a^2\,c}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}+{\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}+1\right )}-\frac {x\,\left (B+A\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{8\,a^2\,c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.52, size = 298, normalized size = 2.55 \[ \begin {cases} - \frac {\left (\left (- 256 i A a^{4} c^{2} f^{2} e^{2 i e} + 256 B a^{4} c^{2} f^{2} e^{2 i e}\right ) e^{- 4 i f x} + \left (- 1536 i A a^{4} c^{2} f^{2} e^{4 i e} + 512 B a^{4} c^{2} f^{2} e^{4 i e}\right ) e^{- 2 i f x} + \left (512 i A a^{4} c^{2} f^{2} e^{8 i e} + 512 B a^{4} c^{2} f^{2} e^{8 i e}\right ) e^{2 i f x}\right ) e^{- 6 i e}}{8192 a^{6} c^{3} f^{3}} & \text {for}\: 8192 a^{6} c^{3} f^{3} e^{6 i e} \neq 0 \\x \left (- \frac {3 A - i B}{8 a^{2} c} + \frac {\left (A e^{6 i e} + 3 A e^{4 i e} + 3 A e^{2 i e} + A - i B e^{6 i e} - i B e^{4 i e} + i B e^{2 i e} + i B\right ) e^{- 4 i e}}{8 a^{2} c}\right ) & \text {otherwise} \end {cases} - \frac {x \left (- 3 A + i B\right )}{8 a^{2} c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________